package com.youth.servicebase.exceptionhandler;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
* 创建自定义异常
* */
@Data
@AllArgsConstructor   /*生成有参构造方法*/
@NoArgsConstructor    /*生成无参构造方法*/
public class GlobalException extends RuntimeException{
    @ApiModelProperty(value = "状态码")
    private Integer code;
    private String msg;

    @Override
    public String toString() {
        return "GlobalException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }

}